package strategy.order;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;

/**
 * 用户
 * @author Fengdong.Duan
 * @create 2023/12/5 13:24
 */
public class Client {
    public static void main(String[] args) {
        // 直减
        ZJCouponDiscount zjCouponDiscount = new ZJCouponDiscount();
        Context<Double> zj = new Context<>(zjCouponDiscount);
        BigDecimal discountAmount = zj.discountAmount(20d, new BigDecimal(100));
        System.out.println("直减优惠后金额 :" + discountAmount);
        // 活动还有满 50 - 5
        MJCouponDiscount mjCouponDiscount = new MJCouponDiscount();
        Context<Map<String, BigDecimal>> mj = new Context<>(mjCouponDiscount);
        Map<String, BigDecimal> coupon = new HashMap<>();
        coupon.put("50", new BigDecimal(5));
        discountAmount = mj.discountAmount(coupon, discountAmount);
        System.out.println("满减优惠后金额 :" + discountAmount);
        // 用户还有75%折扣
        ZKCouponDiscount zkCouponDiscount = new ZKCouponDiscount();
        Context<Double> zk = new Context<>(zkCouponDiscount);
        discountAmount = zk.discountAmount(0.75d, discountAmount);
        System.out.println("折扣优惠后金额 :" + discountAmount);
    }
}
